package com.leo.auth.controller;

import lombok.AllArgsConstructor;
import org.bouncycastle.asn1.eac.RSAPublicKey;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.security.KeyPair;
import java.util.Map;

/**
 * <p>
 * RSA公钥开放接口
 * </p>
 *
 * @author ：Leo
 * @since ：2021-04-09 14:47
 */
@RestController
@AllArgsConstructor
@RequestMapping("/petUnionAuth")
public class PublicKeyController {
    private final KeyPair keyPair;

    @GetMapping("rsa/publicKey")
    public Map<String, Object> getKey() {
        RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();

        return null;
    }
}
